package cn.wxManage.common.controller;

import cn.common.common.model.ServerResponse;
import cn.wxManage.common.service.IUtilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created by Zhang on 2018/12/11.
 */
@RestController
@RequestMapping("/util")
public class UtilController {
    @Autowired
    IUtilService iUtilService;

    @PutMapping(value = "/uploadImg")
    public ServerResponse<?> uploadImg(@RequestParam("path") String path,
                                       @RequestParam("img") MultipartFile multipartFile){
        return iUtilService.uploadImg(path,multipartFile);
    }

    @GetMapping(value = "/getDistrictList")
    public ServerResponse<?> getDistrictList(@RequestParam("keywords") String keywords){
        return iUtilService.getDistrictList(keywords);
    }
}
